package com.ulic.customerManApplication.messagemodule.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.commonmodule.bo.BirthdayMessage;
import com.ulic.customerManApplication.messagemodule.bo.MessageRecord;
import com.ulic.customerManApplication.messagemodule.dao.MessageDao;
import com.ulic.customerManApplication.messagemodule.service.MessageService;
import com.ulic.customerManApplication.messagemodule.vo.MessageRecordVO;
import com.ulic.customerManApplication.pager.PagerModel;
import com.ulic.customerManApplication.usermodule.bo.User;

@Component("messageService")
public class MessageServiceImpl implements MessageService {

	private MessageDao messageDao;
	
	public MessageDao getMessageDao() {
		return messageDao;
	}
	@Resource
	public void setMessageDao(MessageDao messageDao) {
		this.messageDao = messageDao;
	}

	@Override
	public void addBirthdayBless(BirthdayMessage birthdayMessage) {
		messageDao.insertBirthdayBless(birthdayMessage);
	}

	@Override
	public void addMessageRecords(MessageRecord messageRecord) {
		messageDao.insertMessageRecords(messageRecord);
	}

	@Override
	public MessageRecord getMessageRecordById(int id) {
		return messageDao.getMessageRecordById(id);
	}

	@Override
	public PagerModel getMessageRecords(int curPage) {
		return messageDao.getMessageRecords(curPage);
	}

	@Override
	public PagerModel getMessageRecords(MessageRecordVO messageRecordVO,
			int curPage) {
		return messageDao.getMessageRecords(messageRecordVO, curPage);
	}

	@Override
	public void removeMessageRecord(MessageRecord messageRecord) {
		messageDao.deleteMessageRecord(messageRecord);
	}
	@Override
	public BirthdayMessage getBirthdayMessageByType(User user,String type) {
		return messageDao.getBirthdayMessageByType(user,type);
	}

}
